package com.green.model.manage;

import com.green.model.ExtraEntity;
import com.green.model.common.Constants;
/**
 * 人员T_qfang_green_PERSON
 * @author gogole
 */
public class Person extends ExtraEntity<String> {
	
	private static final long serialVersionUID = -7755163721526526238L;
	private String number; //工号
	private String userName; //登录账号
	private String password; //密码
	private String name; //姓名
	private int gender; //性别1:男；2：女
	private String cell; //电话
	private Position position; //岗位
	private String shortNumber; //公司短号
	private String idcard;  //身份证号
	private Org org; //所属组织--冗余字段
	private Org parentOrg;  //所属父组织--冗余字段
    private String telphone; //固定电话
    private int isForbidden; //是否禁用1:是；0：否
    private String photoUrl; //头像图片地址
    
    @SuppressWarnings("unused")
	private String cellStr;	//格式化电话号码（344格式）
    private String cityName;	//拼接城市名称
    private String areaName;	//拼接区域名称
    private String plateName;	//拼接板块名称
    private String cityIds;	//拼接城市Ids
    private String areaIds;	//拼接区域Ids
    private String plateIds;	//拼接板块Ids
    private String currentCity; //当前登陆城市名称
    private Org controUnit; //控制单元
    private int isPlate=0; //1:是；0：否
    
	
    
	public int getIsPlate() {
		return isPlate;
	}

	public void setIsPlate(int isPlate) {
		this.isPlate = isPlate;
	}

	public Org getControUnit() {
		return controUnit;
	}

	public void setControUnit(Org controUnit) {
		this.controUnit = controUnit;
	}

	public String getCityIds() {
		return cityIds;
	}

	public void setCityIds(String cityIds) {
		this.cityIds = cityIds;
	}

	public String getAreaIds() {
		return areaIds;
	}

	public void setAreaIds(String areaIds) {
		this.areaIds = areaIds;
	}

	public String getPlateIds() {
		return plateIds;
	}

	public void setPlateIds(String plateIds) {
		this.plateIds = plateIds;
	}

	public String getNumber() {
		return number;
	}
	
	public String getPhotoUrl() {
		if(null==photoUrl||photoUrl.equals("")){
			photoUrl=Constants.DEFAULT_IMAGE_URL;
		}
		return photoUrl;
	}

	public void setPhotoUrl(String photoUrl) {
		this.photoUrl = photoUrl;
	}

	public void setNumber(String number) {
		this.number = number;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public int getIsForbidden() {
		return isForbidden;
	}
	public void setIsForbidden(int isForbidden) {
		this.isForbidden = isForbidden;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getGender() {
		return gender;
	}
	public void setGender(int gender) {
		this.gender = gender;
	}
	public String getCell() {
		return cell;
	}
	public void setCell(String cell) {
		this.cell = cell;
	}
	public Position getPosition() {
		return position;
	}
	public void setPosition(Position position) {
		this.position = position;
	}
	public String getShortNumber() {
		return shortNumber;
	}
	public void setShortNumber(String shortNumber) {
		this.shortNumber = shortNumber;
	}
	public String getIdcard() {
		return idcard;
	}
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	
	public Org getOrg() {
		return org;
	}
	public void setOrg(Org org) {
		this.org = org;
	}
	public String getTelphone() {
		return telphone;
	}
	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}
	public String getCellStr() {
		if(cell == null || cell.length() != 11){
			return cell;
		}
		char[] charArr = new char[11];
		for (int i = 0; i < cell.length(); i++) {
			charArr[i]=cell.charAt(i);
		}
		StringBuilder phone = new StringBuilder("");
		for (int i = 0; i < charArr.length; i++) {
			if(i == 3 || i == 7){
				phone.append(" ");
			}
			phone.append(charArr[i]);
		}
		
		return phone.toString();
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	public String getPlateName() {
		return plateName;
	}

	public void setPlateName(String plateName) {
		this.plateName = plateName;
	}

	public String getCurrentCity() {
		return currentCity;
	}

	public void setCurrentCity(String currentCity) {
		this.currentCity = currentCity;
	}

	public Org getParentOrg() {
		return parentOrg;
	}

	public void setParentOrg(Org parentOrg) {
		this.parentOrg = parentOrg;
	}
}
